/**
 * 
 */
package com.hstypay.demo.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hstypay.demo.dao.entity.HsUserMessage;
import com.hstypay.demo.dao.mapper.HsUserMessageMapper;
import com.hstypay.demo.dto.HsUserMessageDTO;
import com.hstypay.demo.facade.HsUserMessageService;
import com.hstypay.mybatis.pagination.dto.Search;
import com.hstypay.sandbox.support.BeanConvertHelper;

/**
 * @author admin
 *
 */
@Service
public class HsUserMessageServiceImpl implements HsUserMessageService {
	@Resource
	private HsUserMessageMapper hsUserMessageMapper;
	
	@Override
	public List<HsUserMessageDTO> queryByUserId(Long userId) {
		Search search = Search.toSearch(1);
		Map<String, Object> searchMap = new HashMap<String, Object>();
		searchMap.put("userId", userId);
		search.setSearch(searchMap);
		List<HsUserMessage> hsUserMessageList = hsUserMessageMapper.queryPageList(search);
		return BeanConvertHelper.copyListProperties(hsUserMessageList, HsUserMessageDTO.class);
	}

}
